@import "../../devui/style/theme/color";
body {
  background: $white;
}

@mixin menu(){
  position: fixed;
  display: block;
  font-size: 12px;
  z-index: 5;
  width: 4em;
  height: 4em;
  padding: 1em;
  transition: all 0.2s ease-out;
  span {
    position: relative;
    display: block;
    margin-top: 0.9em;
    &:before, &:after{
      position: absolute;
      top: -.55em;
      content: " ";
    }
    &:after{
      top: .55em;
    }
    &, &:before, &:after{
      background-color: $white;
      width: 100%;
      height: .2em;
      transition: all .4s;
    }
  }
  &.active span{
    background: transparent;
    &:before{
      transform: rotate(45deg) translate(.5em, .4em);
    }
    &:after{
      transform: rotate(-45deg) translate(.4em, -.3em);
    }
  }
}
.app-container {
  display: flex;
  flex-direction: column;
  transform: none;
  .app-bar {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    z-index: 10;
  }

  a.main-nav-item {
    cursor: pointer;
  }

  header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    width: 100%;
    height: 50px;
    background: $white;
    box-shadow: 0 2px 4px 0 rgba(41,48,64,0.20);
    a {
      line-height: 26px;
      color: $dark1;
      text-decoration: none;
    }

    a:hover, a:focus {
      color: $dark1;
      text-decoration: none;
    }
  }

  h1.title {
    font-size: 20px;
    margin: 0;
    font-weight: bold;
    padding: 9px 20px;
    box-sizing: border-box;
    .logo, .text {
      display: inline-block;
      vertical-align: top;
    }
    .ui {
      font-weight: normal;
    }
    a:hover {
      text-decoration: none;
    }

    .internal {
      font-size: small;
      background-color: #5E7CE0;
      color: white;
      margin-left: 5px;
      font-weight: normal;
      line-height: 10px;
      display: inline-block;
      padding: 3px 4px 0;
    }
  }

  .main-nav {
    display: flex;
    justify-content: flex-end;
    margin-right: 20px;
  }

  .header-menu{
    right: 5px;
    @include menu();
    display: none;
    span {
      &, &:before, &:after{
        background: $dark;
      }

    }
  }

  .main-nav-item {
    font-size: 15px;
    display: block;
    padding: 5px 0;
    margin: 0 12px;
    color:$dark1;

    &:hover {
      text-decoration: none;
      color:$hover-control;
    }
    &:active, &:focus {
      color: $focus1;
    }

    &.active {
      color: $focus1;
    }
    &.version-label{
      cursor: default;
      &:hover, &:focus{
        color: inherit;
      }
    }
  }

  .wrapper {
    display: flex;
    flex: 1;
    flex-direction: row;
    position: absolute;
    top: 50px;
    left: 0;
    right: 0;
    bottom: 0;
    .sidebar {
      box-sizing: border-box;
      position: fixed;
      top: 50px;
      bottom: 0;
      left: 0;
      width: 240px;
      margin-left: -240px;
      border-right: 1px solid $gray2;
      height: 100%;
      overflow-y: hidden;
      z-index: 2;
      background: $white;
      transition: all .2s ease-out;
      &:hover{
        overflow-y: auto;
      }
    }

    .menu-link {
      left: 0;
      background: rgba($dark, 0.7);
      @include menu();
    }

    .doc-viewer-container {
      width: 100%;
      margin-left:0;
      // overflow-y: auto;
      .main{
        width: 100%;
        padding: 0 20px;
      }
    }
    &.active {
      .sidebar{
        overflow-y: auto;
        left: 240px;
      }
      .doc-viewer-container {
        width: calc(100% - 240px);
        margin-left: 240px;
      }
      .menu-link{
        left: 240px;
      }
    }
  }

  .tabNav {
    text-decoration: none;
    width: 100%;
    height: 100%;
    display: block;
  }

  .side-nav {
    background: $white;
    padding-bottom: 72px;

    .list-group {
      margin-bottom: 0;
      .list-group-item {
        &:hover{
          background-color: $hover-content;
        }
        &:focus{
          background-color: $focus3;
        }
      }
      .text-overflow-ellipsis{
        overflow: hidden;
        text-overflow: ellipsis;
        word-break: break-all;
        white-space:nowrap;
      }
    }

    ul {
      margin: 0;
    }

    .panel-body {
      padding: 0;
      background-color: $white;
    }

    .panel-title {
      font-size: 12px;
      font-weight: normal;
      color: $dark3;
      margin: 0;
      position: relative;
      line-height: 40px;
    }

    .panel > .panel-heading, .panel.panel-default > .panel-heading {
      background: $white;
      padding-left: 20px;
    }

    .panel {
      box-shadow: none;
    }

    [class*="panel-"] > .panel-heading {
      cursor: pointer;
      &:hover {
        color: $hover-control;
      }
    }

    .panel-group .panel-heading + .panel-collapse > .panel-body {
      border: none;
    }
  }

  .side-nav .list-group li > a {
    box-sizing: border-box;
    display: block;
    font-size: 14px;
    font-weight: 400;
    line-height: 40px;
    text-decoration: none;
    -webkit-transition: all .2s;
    transition: all .2s;
    padding-left: 40px;
    position: relative;
    outline: none;
    color: $dark1;
  }

  .side-nav li {
    a:hover{
      background: $hover-content;
    }
    a:focus{
      background: $focus3;
    }
  }

  .side-nav .list-group-item.active {
    outline: none;
    color: $focus1;
    border-right: 2px solid $focus1;
    background-color: $focus3;
    &:hover,&:focus{
      outline: none;
    }
  }
}

.devui-menu {
  outline: none;
  margin-top: 20px;
  margin-bottom: 0;
  padding-left: 0;
  list-style: none;
  z-index: 1050;
  background: $white;
}
.devui-menu-item {
  font-size: 14px;
  text-overflow: ellipsis;
  overflow: hidden;
  font-size: 14px;
  line-height: 40px;
  padding-left: 20px;
  &:hover{
    background-color: $hover-content;
  }
}
.devui-menu-item>a {
  display: block;
  color: $dark1;
  text-decoration: none;
}

.devui-menu-item-selected {
  color: $focus1;
  background-color: $focus3;
  border-right: 2px solid $focus1;
  a{
    color: inherit;
  }
}

.demo-container{
  position: relative;
  padding-bottom: 30px;
  margin-top: 20px;
}

.demo-content {
  margin-right: 200px;
}

.demo-example {
  margin-bottom: 20px;
}
.demo-nav {
  position: absolute;
  height: 100%;
  top:0;
  right: 0;
  width: 150px;
  line-height: 24px;
}

.demo-nav .items {
  margin-top: 10px;
  cursor: pointer;
}

.demo-nav .items>li:hover {
  color: $focus1;
}

.demo-nav-active {
  color: $focus1;
}

.demo-title {
  font-size: 14px;
  color: $dark1;
  line-height: 24px;
  font-weight: bold;
  margin-bottom: 10px;
}

.demo-text {
  font-size: 14px;
  color: $dark1;
  line-height: 24px;
}
.readme {
  .hljs{
    background: transparent;
  }
  pre {
    background-color: $white;
    border: none;
    code {
      border: 1px solid #e9e9e9;
      overflow-x: auto;
    }
  }
  p {
    margin: 1em 0;
  }
}

@media (max-width: 768px) {
  .app-container {
    .header-menu{
      display: block;
    }
    header {
      flex-direction: column;
      justify-items: center;
      .main-nav{
        display: none;
      }
      &.active{
        height: 205px;
        .main-nav{
          display: flex;
          flex-direction: column;
          width: 100%;
          margin-left: 20px;
        }
      }
    }
  }
}

@media (min-width: 1024px) {
  .app-container .wrapper {
    .sidebar {
      left: 240px;
    }
    .doc-viewer-container{
      margin-left: 240px;
      width: calc(100% - 240px);
      .main{
        padding: 0 60px;
      }
    }
    .menu-link {
      display: none;
    }
  }
}

@media (min-width: 1280px) {
  .app-container .wrapper {
    .doc-viewer-container{
      .main{
        padding: 0 20%;
      }
    }
  }
}
